package com.hnust.root.common.base.exception;

/**
 * @Author zhusir
 * @Date 2018/12/17
 * @Desc 专门用于表示数据库操作失败的异常,需要事务保证时需要抛出此异常
 * 因为事务需要捕获RuntimeException及其子类才可实现回滚
 */
public class DBException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String message;

    @Override
    public String getMessage() {
        return message;
    }

    public DBException() {}

    public DBException(String message) {
        super(message);
        this.message = message;
    }
}
